/**
 * wap to creating procedure with out parameter 
 */
import java.sql.*;
import java.util.*;
class JdbcDemo33 {
	public static void main(String[] args) throws Exception {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection cn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
		CallableStatement cs=cn.prepareCall("{call update_sal2(?,?,?)}");
		Scanner scan=new Scanner(System.in);
		cs.registerOutParameter(3, Types.NUMERIC);
		System.out.println("nput emp no");
		int eno = scan.nextInt();
		System.out.println("iinput salary");
		float s=scan.nextFloat();
		cs.setInt(1, eno);
		cs.setFloat(2, s);
		cs.execute();
		float r=cs.getFloat(3);
		System.out.println("after updating salary, employee salary is"+r);
		cs.close();
		cn.close();
	}

}
